<template>
    <el-container>
        <el-header :style="{backgroundColor: originMenuProp.backgroundColor}">
            <el-row class="st-height-100-pc">
                <el-col :span="3" class="st-color-white st-flex-center-all st-height-100-pc"><div>SCATTER GENERATOR</div></el-col>
                <el-col :span="16" class="st-flex-center-all">
                    <StElMenu :datas="menuDatas" :origin-prop="originMenuProp" :index="(menu)=>{return menu.url || menu.id}"></StElMenu>
                </el-col>
            </el-row>
        </el-header>
        <el-main>
           <StElRouterView :level="2"></StElRouterView>
        </el-main>
    </el-container>
</template>

<script>
    import ConfigParamsUrl from '../../../../web/pc/config/ConfigParamsUrl.js'
    import ConfigTemplateUrl from '../../../../web/pc/config/ConfigTemplateUrl.js'
    import ConfigDatasourceUrl from '../../../../web/pc/config/ConfigDatasourceUrl.js'
    import TableGenHistoryUrl from '../../../../web/pc/history/TableGenHistoryUrl'
    import GenUrl from './gen/GenUrl.js'
    export default {
        name: "Index",
        computed:{
            originMenuProp(){
                return {
                    backgroundColor: '#304156',
                    textColor: '#fff',
                    activeTextColor: '#ffd04b',
                    mode: 'horizontal',
                    router: true,
                    defaultActive: this.$route.path
                }
            }
        },
        data() {
            return {
                menuDatas: [
                    {
                        id: '1',
                        name: '1 参数配置',
                        url: ConfigParamsUrl.router.searchList,
                        isMenu: false,
                        isPage: true
                    },
                    {
                        id: '2',
                        name: '2 模板配置',
                        url: ConfigTemplateUrl.router.searchList,
                        isMenu: false,
                        isPage: true
                    },
                    {
                        id: '3',
                        name: '3 数据源配置',
                        url: ConfigDatasourceUrl.router.searchList,
                        isMenu: false,
                        isPage: true
                    },
                    {
                        id: '4',
                        name: '4 代码生成',
                        url: GenUrl.router.gen,
                        isMenu: false,
                        isPage: true
                    },
                    {
                        id: '5',
                        name: '5 历史记录',
                        url: TableGenHistoryUrl.router.searchList,
                        isMenu: false,
                        isPage: true
                    },
                    {
                        id: '6',
                        name: '项目/组件生成',
                        url: GenUrl.router.genComponent,
                        isMenu: false,
                        isPage: true
                    },
                ],
            }
        },
        methods: {

        }
    }
</script>

<style scoped>

</style>